<?php
require_once('../../../../config.php');
global $CFG;
$user_id = $_GET['user_id'];
$assignment_id = $_GET['assignment_id'];
$rec = get_record('seniorproject', 'user_id', $user_id, 'assignment_id', $assignment_id);
if($rec->signed){
	$rec->signed = 0;
	$output = "has not signed off";
}else{
	$rec->signed = 1;
	$output = "has signed off";
}
if(update_record('seniorproject', $rec)){
	echo $output;
}else{
	echo "An error occurred. Refresh this page and try again.";
}
?>
